package com.libgdxbar.pvzlikegame.asset;


import org.libgdxbar.projects.interfaces.asset.AssetCallback;

import java.util.Objects;

public class AssetExecution {
    private final String fileName;
    private final Class<?> type;
    private final AssetCallback<?> callback;

    AssetExecution(String fileName, Class<?> type, AssetCallback<?> callback) {
        this.fileName = fileName;
        this.type = type;
        this.callback = callback;
    }

    public String getFileName() {
        return fileName;
    }

    public Class<?> getType() {
        return type;
    }

    public AssetCallback<?> getCallback() {
        return callback;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AssetExecution that = (AssetExecution) o;
        return Objects.equals(fileName, that.fileName) && Objects.equals(type, that.type) && Objects.equals(callback, that.callback);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fileName, type, callback);
    }
}
